﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Web/FarmMaster.master" AutoEventWireup="true" CodeFile="detail.aspx.cs" Inherits="Web_detail" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div id="main">
		<div class="left">
			<div class="left1">
				<div id="PARENT">
					<ul	id="navv">
						<li class="first"><a><%=parent.Name %></a>
						</li>
                        <%
                        
                        if (GetChild(parent.ID) == null)
                        { 
                    %>      <li><a href='list.aspx?topic_id=<%=parent.ID %>'><%=parent.Name%></a></li>
                    <%  }
                        else
                        {
                            int i = 2;
                            foreach (Topic t in GetChild(parent.ID))
                            {
                                if (GetChild(t.ID) == null)
                                { 
                   %>
                                    <li><a href='list.aspx?topic_id=<%=t.ID %>'><%=t.Name%></a></li>
                   <%                 
}
                                else
                                {
                                    string str1 = "#Menu=ChildMenu" + i;
                                    string str2 = "ChildMenu" + i;
                   %>               
                       <li  class="first_link"><a href="<%=str1 %>"	onclick="DoMenu('<%=str2 %>')"><%=t.Name %></a>
							<ul	id="<%=str2 %>"	class="collapsed">
                   <%
                                   foreach (Topic ti in GetChild(t.ID))
                                   { 
                               %>
                                        <li><a href='list.aspx?topic_id=<%=ti.ID %>'><%=ti.Name %></a></li>
                               <%         
                                   }   
                   %>           
							</ul>
						</li>
                   <%               i++;               
                                }
                            }
                        }
                    %>

					</ul>
				</div>
			</div>
			<div class="left2" style="padding-top:13px;">
				<div class="tle">
					<span class="text1">培训通知</span>
				</div>
				<div class="tents">
					<ul style=" padding-top:5px;">
                        <asp:Repeater ID="Repeater1" runat="server">
                             <ItemTemplate>
                                <li><a href='ViewTrain.aspx?pid=<%#Eval("id") %>'><%#Eval("name").ToString().Length > 13 ? Eval("name").ToString().Substring(0, 12) + "..." : Eval("name")%></a></li>
                            </ItemTemplate>
                        </asp:Repeater>
					</ul>
				</div>
			</div>
			<div class="left2">
				<div class="tle">
					<span class="text1">最新动态</span>
				</div>
				<div class="tents">
					<ul style=" padding-top:5px;">
                        <asp:Repeater ID="Repeater2" runat="server">
                             <ItemTemplate>
                                <li><a href='detail.aspx?article_id=<%#Eval("id") %>'><%#Eval("Title").ToString().Length>12?Eval("Title").ToString().Substring(0,11)+"...":Eval("Title") %></a></li>
                            </ItemTemplate>
                        </asp:Repeater>
					</ul>
				</div>
			</div>
		</div>
		<div class="right">
			<div class="headline">
				您的当前位置：<%=path %>
			</div>
			<div class="content">
				<div class="title">
					<div class="writing">
						<%=art.Title %>
					</div>
					<div class="information">
						<ul>
							<li class="first">发布人：<%=art.Creator.Name %></li>
							<li class="second">来源：<%=art.District %></li>
							<li class="second">发表日期：<%=string.Format("{0:yyyy-MM-dd}",art.Published) %></li>
							<li class="third">点击次数：<%=art.Clicked %></li>
						</ul>
					</div>
				</div>
				<div class="detail">
					<span class="d2">
						<%=art.Body %>
					</span>
				</div>
			</div>
		</div>
	</div>
    <script type="text/javascript"><!--
        var LastLeftID = "";
        function menuFix() {
            var obj = document.getElementById("navv").getElementsByTagName("li");

            for (var i = 0; i < obj.length; i++) {
                obj[i].onmouseover = function () {
                    this.className += (this.className.length > 0 ? " " : "") + "sfhover";
                }
                obj[i].onMouseDown = function () {
                    this.className += (this.className.length > 0 ? " " : "") + "sfhover";
                }
                obj[i].onMouseUp = function () {
                    this.className += (this.className.length > 0 ? " " : "") + "sfhover";
                }
                obj[i].onmouseout = function () {
                    this.className = this.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
                }
            }
        }
        function DoMenu(emid) {
            var obj = document.getElementById(emid);
            obj.className = (obj.className.toLowerCase() == "expanded" ? "collapsed" : "expanded");
            if ((LastLeftID != "") && (emid != LastLeftID)) //关闭上一个Menu
            {
                document.getElementById(LastLeftID).className = "collapsed";
            }
            LastLeftID = emid;
        }
        function GetMenuID() {
            var MenuID = "";
            var _paramStr = new String(window.location.href);
            var _sharpPos = _paramStr.indexOf("#");

            if (_sharpPos >= 0 && _sharpPos < _paramStr.length - 1) {
                _paramStr = _paramStr.substring(_sharpPos + 1, _paramStr.length);
            }
            else {
                _paramStr = "";
            }

            if (_paramStr.length > 0) {
                var _paramArr = _paramStr.split("&");
                if (_paramArr.length > 0) {
                    var _paramKeyVal = _paramArr[0].split("=");
                    if (_paramKeyVal.length > 0) {
                        MenuID = _paramKeyVal[1];
                    }
                }
                /*
                if (_paramArr.length>0)
                {
                var _arr = new Array(_paramArr.length);
                }
  
                //取所有#后面的，菜单只需用到Menu
                //for (var i = 0; i < _paramArr.length; i++)
                {
                var _paramKeyVal = _paramArr[i].split('=');
   
                if (_paramKeyVal.length>0)
                {
                _arr[_paramKeyVal[0]] = _paramKeyVal[1];
                }  
                }
                */
            }

            if (MenuID != "") {
                DoMenu(MenuID)
            }
        }
        GetMenuID(); //*这两个function的顺序要注意一下，不然在Firefox里GetMenuID()不起效果
        menuFix();
--></script>
</asp:Content>

